package mark.tom.friend.roll.test

import android.app.Application
import com.squareup.leakcanary.LeakCanary
import mark.tom.friend.FRoll
import mark.tom.friend.roll.test.koltin.BuildConfig
import timber.log.Timber

class CustomApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        // init LeakCanary
        if (!LeakCanary.isInAnalyzerProcess(this)) {
            LeakCanary.install(this)
        }
        if (BuildConfig.DEBUG) {
            // init Timber
            Timber.plant(Timber.DebugTree())
        }
        FRoll.init(this)
                .serverChecker { packageName, content -> true }
                .extraChecker { packageName, content -> true }
                .checkResultNotifier { msg -> Timber.d(msg) }
                .build()
        // 测试Application启动时是否能获取到数据
        Timber.d(FRoll.get().toString())
    }

}
